package com.baizhi.web_demo;

public class RegDemo04 {
    public static void main(String[] args) {
        String password = "123456";

        String reg = "[a-zA-Z0-9]{3,6}";

        if(password.matches(reg)){
            System.out.println("密码格式正确");
        }else{
            System.out.println("密码格式不正确");
        }
    }
}
